﻿<%@ Control Language="C#" AutoEventWireup="true" CodeFile="BaoCaoDoanhSoKhachHang.ascx.cs" Inherits="WebUserControl_BaoCaoDoanhSoKhachHang" %>
<%@ Register src="uscTitleForm.ascx" tagname="uscTitleForm" tagprefix="uc2" %>
<%@ Register assembly="AjaxControlToolkit" namespace="AjaxControlToolkit" tagprefix="cc1" %>

<link rel="stylesheet" href='<%=ResolveUrl("~/LayoutCss/K_BaoCaoFormLayout.css")%>' type="text/css" />
<link rel="stylesheet" href='<%=ResolveUrl("~/LayoutCss/datePicker.css")%>' type="text/css" />

<script type="text/javascript">
     function pageLoad() {
     
     $(function()
        {
	            $("#<%= txtFromDate.ClientID %>").datePicker(
	                {
	                    clickInput:true,
			            startDate: '01/01/1970'
	                }
	                );
        });
	            
	            $("#<%= txtFromDate.ClientID %>").bind(
		            'dpClosed',function(e, selectedDates)
		                        {
			                        var d = selectedDates[0];
			                        if (d) {
				                            d = new Date(d);
				                            $("#<%= txtToDate.ClientID %>").dpSetStartDate(d.addDays(0).asString());
			                                }
		                        }
	                    );
	                    
	     $(function()
        {
	            $("#<%= txtToDate.ClientID %>").datePicker(
	                {
	                    clickInput:true
			           
	                }
	                );
        });
	
	          $("#<%= txtToDate.ClientID %>").bind(
		           'dpClosed',function(e, selectedDates)
		                        {
			                        var d = selectedDates[0];
			                        if (d) {
				                            d = new Date(d);
				                            $("#<%= txtFromDate.ClientID %>").dpSetEndDate(d.addDays(0).asString());
			                                }
		                        }
	            );


     
      $("#<%= btReport.ClientID %>").click(function() { 
        $.blockUI({
             message: '<h1>Xin vui lòng chờ xử lý</h1>', 
            css: { 
            border: 'none', 
            padding: '15px', 
            backgroundColor: '#f00', 
            opacity: .5, 
            color: '#fff' 
        } }); 
          setTimeout($.unblockUI, 7000); 
        }); 
     
        Sys.WebForms.PageRequestManager.getInstance().add_endRequest(EndRequestHandler);
                function EndRequestHandler(sender, args) {
                        $.unblockUI();
                }
        }  
   
</script> 

<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<Triggers>
<asp:PostBackTrigger ControlID="btReport" />
</Triggers>
<ContentTemplate>
<fieldset>
    <legend>Báo cáo doanh số khách hàng</legend>
     <div class="fm-req">
      <label for="txtFromDate">Từ ngày:</label>
       <asp:TextBox ID="txtFromDate" runat="server"></asp:TextBox>
      </div>

    <div class="fm-req">
      <label for="txtToDate">Đến ngày:</label>
            <asp:TextBox ID="txtToDate" runat="server"></asp:TextBox>
           
        </div>
</fieldset>

<div>
    
       <asp:Button ID="btReport" runat="server" Text="Báo cáo" onclick="btReport_Click" />
   </div>
 
</ContentTemplate>
</asp:UpdatePanel>
